import "./index.scss";
import NHVideo from "@/components/NHVideo";
import { defaultVideoURL } from "@/libs/static";
import { useEffect } from "react";
import { useState } from "react";
import PlaySvg from "@/components/svg/play";

const DemoPage = () => {
  // 音量值
  const [volume, setVolume] = useState(50);

  useEffect(() => {
    console.log("#effect");
  }, [volume]);

  const onVolumeChange = (value) => {
    console.log("#设置音量变量", value);

    setVolume(value, () => {
      console.log(1111);
    });
  };
  return (
    <>
      <div className="demo_page_wrap">
        <NHVideo
          id="demo_video"
          width={1062}
          height={600}
          url={defaultVideoURL}
          autoPlay={false}
          radius={8}
          shadow={""}
          control={true}
          defaultVolume={volume}
          onVolumeChange={onVolumeChange}
        />
        <PlaySvg />
      </div>
    </>
  );
};

export default DemoPage;
